package com.itheima.controller.advic;

import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class ExceptionAdviceController {

    @ExceptionHandler(AccessDeniedException.class)
    public String accessDeniedException(){
        return "forward:/403.jsp";
    }

    @ExceptionHandler(RuntimeException.class)
    public String runTimeException(){
        return "forward:/500.jsp";
    }

    @ExceptionHandler(Exception.class)
    public String exception(){
        return "forward:/500.jsp";
    }
}
